using Google.ProtocolBuffers;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class ImgPair : GeneratedMessageLite<ImgPair, ImgPair.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<ImgPair, ImgPair.Builder>
		{
			private bool resultIsReadOnly;
			private ImgPair result;
			protected override ImgPair.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override ImgPair MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override ImgPair DefaultInstanceForType
			{
				get
				{
					return ImgPair.DefaultInstance;
				}
			}
			public SKBuiltinBuffer_t ImgBuf
			{
				get
				{
					return this.result.ImgBuf;
				}
				set
				{
					this.SetImgBuf(value);
				}
			}
			public SKBuiltinString_t Username
			{
				get
				{
					return this.result.Username;
				}
				set
				{
					this.SetUsername(value);
				}
			}
			public Builder()
			{
				this.result = ImgPair.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(ImgPair cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private ImgPair PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					ImgPair other = this.result;
					this.result = new ImgPair();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override ImgPair.Builder Clear()
			{
				this.result = ImgPair.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override ImgPair.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new ImgPair.Builder(this.result);
				}
				return new ImgPair.Builder().MergeFrom(this.result);
			}
			public override ImgPair BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override ImgPair.Builder MergeFrom(IMessageLite other)
			{
				if (other is ImgPair)
				{
					return this.MergeFrom((ImgPair)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override ImgPair.Builder MergeFrom(ImgPair other)
			{
				return this;
			}
			public override ImgPair.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override ImgPair.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(ImgPair._imgPairFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = ImgPair._imgPairFieldTags[num2];
					}
					uint num3 = num;
					if (num3 == 0u)
					{
						throw InvalidProtocolBufferException.InvalidTag();
					}
					if (num3 != 10u)
					{
						if (num3 != 18u)
						{
							if (WireFormat.IsEndGroupTag(num))
							{
								return this;
							}
							this.ParseUnknownField(input, extensionRegistry, num, text);
						}
						else
						{
							SKBuiltinString_t.Builder builder = SKBuiltinString_t.CreateBuilder();
							if (this.result.hasUsername)
							{
								builder.MergeFrom(this.Username);
							}
							input.ReadMessage(builder, extensionRegistry);
							this.Username = builder.BuildPartial();
						}
					}
					else
					{
						SKBuiltinBuffer_t.Builder builder2 = SKBuiltinBuffer_t.CreateBuilder();
						if (this.result.hasImgBuf)
						{
							builder2.MergeFrom(this.ImgBuf);
						}
						input.ReadMessage(builder2, extensionRegistry);
						this.ImgBuf = builder2.BuildPartial();
					}
				}
				return this;
			}
			public ImgPair.Builder SetImgBuf(SKBuiltinBuffer_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasImgBuf = true;
				this.result.imgBuf_ = value;
				return this;
			}
			public ImgPair.Builder SetImgBuf(SKBuiltinBuffer_t.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasImgBuf = true;
				this.result.imgBuf_ = builderForValue.Build();
				return this;
			}
			public ImgPair.Builder MergeImgBuf(SKBuiltinBuffer_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasImgBuf && this.result.imgBuf_ != SKBuiltinBuffer_t.DefaultInstance)
				{
					this.result.imgBuf_ = SKBuiltinBuffer_t.CreateBuilder(this.result.imgBuf_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.imgBuf_ = value;
				}
				this.result.hasImgBuf = true;
				return this;
			}
			public ImgPair.Builder ClearImgBuf()
			{
				this.PrepareBuilder();
				this.result.hasImgBuf = false;
				this.result.imgBuf_ = null;
				return this;
			}
			public ImgPair.Builder SetUsername(SKBuiltinString_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasUsername = true;
				this.result.username_ = value;
				return this;
			}
			public ImgPair.Builder SetUsername(SKBuiltinString_t.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasUsername = true;
				this.result.username_ = builderForValue.Build();
				return this;
			}
			public ImgPair.Builder MergeUsername(SKBuiltinString_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasUsername && this.result.username_ != SKBuiltinString_t.DefaultInstance)
				{
					this.result.username_ = SKBuiltinString_t.CreateBuilder(this.result.username_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.username_ = value;
				}
				this.result.hasUsername = true;
				return this;
			}
			public ImgPair.Builder ClearUsername()
			{
				this.PrepareBuilder();
				this.result.hasUsername = false;
				this.result.username_ = null;
				return this;
			}
		}
		public const int ImgBufFieldNumber = 1;
		public const int UsernameFieldNumber = 2;
		private static readonly ImgPair defaultInstance;
		private static readonly string[] _imgPairFieldNames;
		private static readonly uint[] _imgPairFieldTags;
		private bool hasImgBuf;
		private SKBuiltinBuffer_t imgBuf_;
		private bool hasUsername;
		private SKBuiltinString_t username_;
		private int memoizedSerializedSize = -1;
		public static ImgPair DefaultInstance
		{
			get
			{
				return ImgPair.defaultInstance;
			}
		}
		public override ImgPair DefaultInstanceForType
		{
			get
			{
				return ImgPair.DefaultInstance;
			}
		}
		protected override ImgPair ThisMessage
		{
			get
			{
				return this;
			}
		}
		public SKBuiltinBuffer_t ImgBuf
		{
			get
			{
				return this.imgBuf_ ?? SKBuiltinBuffer_t.DefaultInstance;
			}
		}
		public SKBuiltinString_t Username
		{
			get
			{
				return this.username_ ?? SKBuiltinString_t.DefaultInstance;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasImgBuf && this.hasUsername && this.ImgBuf.IsInitialized;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasImgBuf)
				{
					num += CodedOutputStream.ComputeMessageSize(1, this.ImgBuf);
				}
				if (this.hasUsername)
				{
					num += CodedOutputStream.ComputeMessageSize(2, this.Username);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private ImgPair()
		{
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] imgPairFieldNames = ImgPair._imgPairFieldNames;
			if (this.hasImgBuf)
			{
				output.WriteMessage(1, imgPairFieldNames[0], this.ImgBuf);
			}
			if (this.hasUsername)
			{
				output.WriteMessage(2, imgPairFieldNames[1], this.Username);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasImgBuf)
			{
				num ^= this.imgBuf_.GetHashCode();
			}
			if (this.hasUsername)
			{
				num ^= this.username_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object value)
		{
			ImgPair imgPair = value as ImgPair;
			return imgPair != null && (this.hasImgBuf == imgPair.hasImgBuf && (!this.hasImgBuf || this.imgBuf_.Equals(imgPair.imgBuf_))) && (this.hasUsername == imgPair.hasUsername && (!this.hasUsername || this.username_.Equals(imgPair.username_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<ImgPair, ImgPair.Builder>.PrintField("ImgBuf", this.hasImgBuf, this.imgBuf_, writer);
			GeneratedMessageLite<ImgPair, ImgPair.Builder>.PrintField("Username", this.hasUsername, this.username_, writer);
		}
		public static ImgPair ParseFrom(byte[] data)
		{
			return ImgPair.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private ImgPair MakeReadOnly()
		{
			return this;
		}
		public static ImgPair.Builder CreateBuilder()
		{
			return new ImgPair.Builder();
		}
		public override ImgPair.Builder ToBuilder()
		{
			return ImgPair.CreateBuilder(this);
		}
		public override ImgPair.Builder CreateBuilderForType()
		{
			return new ImgPair.Builder();
		}
		public static ImgPair.Builder CreateBuilder(ImgPair prototype)
		{
			return new ImgPair.Builder(prototype);
		}
		static ImgPair()
		{
			ImgPair.defaultInstance = new ImgPair().MakeReadOnly();
			ImgPair._imgPairFieldNames = new string[]
			{
				"ImgBuf",
				"Username"
			};
			ImgPair._imgPairFieldTags = new uint[]
			{
				10u,
				18u
			};
			object.ReferenceEquals(micromsg.Proto.ImgPair.Descriptor, null);
		}
	}
}
